using UnityEngine;
using Framework;
using Framework.Scene;

namespace Game
{
    public sealed class MainScene : BaseScene
    {
        public override void OnCreateScene()
        {
            Log.Info("[MainScene] OnCreateScene");
            this.LoadResource().Coroutine();
            base.OnCreateScene();
        }

        private async FVoid LoadResource()
        {
            await GameEntry.UI.OpenUI(AssetUtility.GetUIPath("Main/MainPanel"));
            this.LoadingPanel.RefreshLoadingProgress(1);
        }

        public override void OnEnterScene()
        {
            Log.Info("[MainScene] OnEnterScene");
            base.OnEnterScene();
        }

        public override void OnLeaveScene()
        {
            Log.Info("[MainScene] OnLeaveScene");
            GameEntry.UI.CloseUI(typeof(MainPanel));
            base.OnLeaveScene();
        }
    }
}